package com.sl.core.domain.dto;

import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Getter
@Setter
public class JsonMappingFieldDefine extends JsonFieldDefine<JsonMappingFieldDefine> {

    /**
     * 映射的path
     */
    private String mappingPath;

    private String mappingJsonPath;

    private String jsonPath;
    private String function;

    private JsonMappingFieldDefine parent;

    // 假设的静态方法，根据路径查找对象
    public static JsonMappingFieldDefine findByPath(String targetPath, List<JsonMappingFieldDefine> fieldList) {
        for (JsonMappingFieldDefine field : fieldList) {
            if (field.getPath().equals(targetPath)) {
                return field;
            }
        }
        return null;
    }

}
